﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using LAVAA.DAL;

namespace TestLavaa
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            LAVAA.DAL.LavaaEntities context = new LAVAA.DAL.LavaaEntities();
            var user = new User()
            {
                Name = "andreas"
            };

            var activity = new Activity()
            {
                Name = "Gå"
            };

            var card = new Card()
            {
                DateFrom = DateTime.Now,
                DateTo = DateTime.Now.AddHours(1),
                Activity = activity,
                User = user
            };

            context.Cards.AddObject(card);
            context.SaveChanges();

            var card2 = context.Cards.Single();

        }
    }
}
